<?php
/**
 * @package			ALM ProductControl
 * @version			$Id:$
 * @subpackage		com_almapc
 * @autor			ALM Studio
 * @copyright		Copyrights ALM Studio 2011. All rights reserved
 * @autor url		http://alm-studio.net
 * @autor email		info@almstudio.net
 */
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controllerform');

class ALMPCModelType extends JModelAdmin
{

	public function getTable($type = 'Type', $prefix = 'ALMPCTable', $config = array()) 
	{
		return JTable::getInstance($type, $prefix, $config);
	}

	public function getForm($data = array(), $loadData = true) 
	{
		$form = $this->loadForm('com_almpc.type', 'type', array('control' => 'jform', 'load_data' => $loadData));
		if (empty($form)) 
		{
			return false;
		}
		return $form;
	}

	protected function loadFormData() 
	{
		$data = JFactory::getApplication()->getUserState('com_almpc.edit.type.data', array());
		if (empty($data)) 
		{
			$data = $this->getItem();
		}
		return $data;
	}
}
